home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / AmigaOS / Aplus_Dev / AP-Website / links / include / sites.php < prev    next >
Encoding:
PHP Script  |  2002-10-28  |  1.3 KB  |  59 lines

  1. <?
  2. // *******************************************************************
  3. //  include/sites.php
  4. // *******************************************************************
  5.  
  6. if(!isset($sr)){
  7.     $sr=0;
  8. }
  9.  
  10. $get_sites_count = sql_query("
  11.     select
  12.         ID
  13.     from
  14.         $tb_links
  15.     where
  16.         Category='$PID'
  17. ");
  18.  
  19. $total_sites = sql_num_rows($get_sites_count);
  20.  
  21. $get_sites = sql_query("
  22.     
  23.     select $tb_links.ID as site_id,
  24.         $tb_links.SiteName as site_name,
  25.         $tb_links.SiteURL as site_url,
  26.         $tb_categories.Category as category_name,
  27.         $tb_categories.ID as cat_id,
  28.         $tb_links.Added as added,
  29.         $tb_links.LastUpdate as last_update,
  30.         $tb_links.Description as site_description,
  31.         $tb_links.Country as country,
  32.         $tb_links.HitsIn as hits_in,
  33.         $tb_links.HitsOut as hits_out,
  34.         count($tb_reviews.ID) as total_reviews
  35.         from
  36.             $tb_links
  37.         left join
  38.             $tb_categories
  39.         on
  40.             $tb_links.Category=$tb_categories.ID
  41.         left join
  42.             $tb_reviews
  43.         on
  44.             $tb_links.ID=$tb_reviews.SiteID
  45.         where
  46.             $tb_links.Category='$PID'
  47.         group by
  48.             site_name
  49.         order by
  50.             site_name
  51.         limit $sr, $pp
  52. ");
  53.  
  54. if($total_sites > 0){
  55.     echo draw_sites($total_sites, $get_sites);
  56. }
  57.  
  58. ?>
  59.